let letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
//document.writeln(letters.length);
let encode = function (ch) {
    return letters.indexOf(ch) < 0 ? ch : letters[(letters.indexOf(ch) + 13) % 26];
};
let rot13 = function (str) { // LBH QVQ VG!
    return str.split('').map(encode).join('');
};

console.log(rot13("SERR PBQR PNZC"));
